[PATCH 2/2] fix: memory leak in Create

From 8307153207e20e218896adbb3ca9dfef63b0742c Mon Sep 17 00:00:00 2001
From: Anna Czarnowska <anna.czarnowska [at] intel.com>
Date: Thu, 17 Feb 2011 22:47:23 +0100
Subject: [PATCH 2/2] fix: memory leak in Create
Cc: linux-raid [at] vger.kernel.org, Williams, Dan J <dan.j.williams [at] intel.com>, Ciechanowski, Ed <ed.ciechanowski [at] intel.com>

match_metadata_desc allocates memory for st
which is not needed after validate_geometry fails

Signed-off-by: Anna Czarnowska <anna.czarnowska [at] intel.com>
---
Create.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Create.c b/Create.c
index a0669fe..ccda07b 100644
--- a/Create.c
+++ b/Create.c
[at] [at] -309,8 +309,10 [at] [at] int Create(struct supertype *st, char *mddev,
if (st && !st->ss->validate_geometry
(st, level, layout, raiddisks,
chunk, size*2, dname, &freesize,
- verbose > 0))
+ verbose > 0)) {
+ free(st);
st = NULL;
+ }
}

if (!st) {
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
anna.czarnowska [ Do, 17 Februar 2011 23:46 ] [ ID #2055398 ]
Linux » gmane.linux.raid » [PATCH 2/2] fix: memory leak in Create

Vorheriges Thema: physical size of the device inconsistent with superblock, after RAID problems
Nächstes Thema: Mixing mdadm versions